feat: adding more validations for types sign v4 messages#8526
Merged
Conversation
ffmcgee725
previously approved these changes
Apr 21, 2026
pedronfigueiredo
previously approved these changes
Apr 21, 2026
jiexi
previously approved these changes
Apr 21, 2026
mcmire
reviewed
Apr 21, 2026
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
11a16b7
Co-authored-by: jiexi <jiexiluan@gmail.com>
Contributor
Author
|
Hey @mcmire : thanks for the feedback, I merged the suggestion to make put the task under "Changed" |
pedronfigueiredo
approved these changes
Apr 22, 2026
ffmcgee725
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Adding more validations for typed sign v4 messaged.
References
Checklist
Note
Medium Risk
Tightens validation on
eth_signTypedData_v4inputs, which may break dapps that previously sent additional top-level fields in typed data. Change is localized but affects a commonly used signing path.Overview
Stricter
eth_signTypedData_v4input validation: the wallet middleware now rejects EIP-712 typed-data JSON that includes any extraneous top-level keys beyond those defined by@metamask/eth-sig-util’sTYPED_MESSAGE_SCHEMA.This introduces a new
validateTypedMessageKeysutility (and tests) and wires it into theeth_signTypedData_v4flow, plus adds coverage ensuring requests with unexpected keys fail withInvalid input.; the changelog is updated accordingly.Reviewed by Cursor Bugbot for commit 3c2ae43. Bugbot is set up for automated code reviews on this repo. Configure here.